import { hostUrl } from "../utils/hostUrl";

export function emailTemplate(captcha: string) {
  const logoUrl = hostUrl("author_logo.svg");
  const mailBgUrl = hostUrl("author_mail_bg.png");
  return `<div class="email-box" style="background:#ecf1f3;padding-top:20px; min-width:820px;">
  <div style="width:801px;height:auto; margin:0 auto;">
    <div style="width:778px;height:auto;margin:0 11px;background:#fff;box-shadow: 6px 3px 5px rgba(0,0,0,0.05);-webkit-box-shadow: 6px 3px 5px rgba(0,0,0,0.05);-moz-box-shadow: 6px 3px 5px rgba(0,0,0,0.05);-ms-box-shadow: 6px 3px 5px rgba(0,0,0,0.05);-o-box-shadow: 6px 3px 5px rgba(0,0,0,0.05);">
      <div style="width:781px; background:#fff;padding-top: 30px;">
        <div style="width:200px;height:100px;background:url(${logoUrl}) center no-repeat; margin:auto;background-size: contain;"></div>
      </div>
      <div style="width:627px;margin:0 auto; padding-left:77px; background:#fff;font-size:14px;color:#55798d;padding-right:77px;"><br>
        <div style="overflow-wrap:break-word;line-height:30px;">
          您正在本站进行验证操作，如非您本人操作，请忽略此邮件。<br>
          <br>
          验证码10分钟内有效，如果超时请重新获取。<br>
          <br>
          您的验证码为：<p style="font-size:34px;color:#3095f1;"><span style="border-bottom: 1px dashed #ccc; z-index: 1; position: static;">${captcha}</span></p>
        </div>
        <br><br><br>
      </div>
    </div>
    <div style="position:relative;top:-15px;width:800px;height: 360px;background:url(${mailBgUrl}) 0 0 no-repeat;">
      <div style="height:200px;color:#507383;font-size:14px;line-height: 1.4;padding: 20px 92px;">
        <div style="font-size: 22px;font-weight: bold;">Author授权系统</div>
        <div style="margin:20px 0;color: #6a8895;min-height:4.2em;white-space: pre-wrap;">此信为系统邮件，请不要直接回复。</div>
      </div>
      <div style="clear:both;"></div>
    </div>
  </div>
</div>`
}
